#include <string>
#include <iostream>

using namespace std;

int main() {
	string s1 = "abcxyz123";
    // 取第 5 个字符
    char c = s1[4]; // 'x'
    cout << "第 5 个字符: " << c << endl;
    cout << "第 8 个字符: " << s1.at(8) << endl;

    // 求长度
    int len = s1.length(); // 9
    cout << "字符串长度: " << len << endl;
	
	string s2;
	s2 = s1;
	s2 = s2 + "yyy";
	cout << s2 << endl;
	
	printf("s2 = %s", s2.c_str());

	
	return 0;
}